package com.ihighest.app.infox.activity;

import android.app.Activity;
import android.os.Bundle;
import android.view.WindowManager;

import com.ihighest.app.common.core.Application;
import com.umeng.analytics.MobclickAgent;
import com.umeng.message.PushAgent;

public class BaseActivity extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		Application.getInstance().addActivity(this);
		/* 优化输入法 */
		getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
		/* 友盟push 统计应用启动数据 */
		PushAgent.getInstance(this).onAppStart();
	}

	@Override
	protected void onResume() {
		super.onResume();
		// 友盟移动统计
		MobclickAgent.onResume(this);
	}

	@Override
	protected void onPause() {
		super.onPause();
		// 友盟移动统计
		if (((Application) getApplication()).mLocationClient != null) {
			((Application) getApplication()).mLocationClient.stop();
		}
		MobclickAgent.onPause(this);
	}

	@Override
	public void onBackPressed() {
		finish();
	}
}
